<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.prime.com.tr/ui"
      xmlns:ui="http://java.sun.com/jsf/facelets" >
<ui:composition template="/templates/principal.xhtml" >
<ui:define name="corpo" >
<h:head>
    <title>Consulta Processos</title>
    <h:outputScript library="js" name="tratardados.js" />
    <!--
        <p:ajaxStatus onstart="statusDialog.show();" onsuccess="statusDialog.hide();"  />
        <p:dialog modal="true" widgetVar="statusDialog" header="Aguarde..." draggable="false" closable="true" resizable="false" width="252" >
            <h:graphicImage library="imagens" name="ajaxloadingbar.gif" />
        </p:dialog>
    -->
</h:head>
<p:growl id="mensagens" globalOnly="true" />
<p:panel header="Consultar processos" style="text-align: center; height: 35px; padding: 0px; font-size: 16px"/>
<p:layout style="width: auto; height: 1024px;" >
    <p:layoutUnit position="left" collapsible="true" width="300" header="" >
        <p:accordionPanel activeIndex="2" autoHeight="false">
            <p:tab title="Gráfico">
                <h:form>
                    <center>
                        <h:outputText value="Processos Ativos" style="font-weight: bold;"/>
                        <br />
                        <br />
                        <p:pieChart model="#{graficoBean.pieModelTotalProcessosAtivos}" width="280"  height="260px" style="piechartStyle" /> 
                    </center>
                    <br />
                </h:form>
            </p:tab>
            <p:tab title="Impressão">
            <h:form id="relacao" prependId="false" >
                <p:fieldset>
                    <h:panelGrid columns="1" >
                        <h:outputLabel value="Tipo de relação:" style="font-weight: bold" />
                            <h:selectOneMenu value="#{filtroBean.relacaoSelecionada}" >
                                <f:selectItem itemValue="-1" itemLabel="Selecione" />
                                <f:selectItem itemValue="1" itemLabel="Processos" />
                                <f:selectItem itemValue="2" itemLabel="Volumes" />
                                <f:selectItem itemValue="3" itemLabel="Anexos" />
                                <p:ajax update="relacao" event="change"  />
                            </h:selectOneMenu>
                        </h:panelGrid>
                        <h:panelGrid columns="1" id="periodo" rendered="#{!empty filtroBean.relacaoSelecionada}">
                            <h:outputLabel value="Data inicial:" style="font-weight: bold" />
                            <p:calendar id="dataIniR" value="#{filtroBean.dataIniRelacao}"  size="12" required="true" showOn="button" validatorMessage="O formato deve ser dd/mm/aaaa" requiredMessage="Campo Data inicial obrigatório!" readOnlyInputText="true" locale="pt,BR" timeZone="America/Sao_Paulo" pattern="dd/MM/yyyy"  /> 
                            <h:outputLabel value="Data final:" style="font-weight: bold" />
                            <p:calendar id="dataFimR" value="#{filtroBean.dataFimRelacao}" size="12" required="true" showOn="button" validatorMessage="O formato deve ser dd/mm/aaaa" requiredMessage="Campo Data final obrigatório!" readOnlyInputText="true" locale="pt,BR" timeZone="America/Sao_Paulo" pattern="dd/MM/yyyy"  /> 
                        </h:panelGrid>
                </p:fieldset>
                <p:fieldset>
                    <center>
                    <h:panelGroup>
                        <p:commandButton value="Imprimir" image="ui-icon ui-icon-print" update="relacao, mensagens" ajax="false" immediate="false" disabled="#{filtroBean.relacaoSelecionada == null or filtroBean.relacaoSelecionada == -1}">
                            <f:setPropertyActionListener target="#{filtroBean.tipoRelatorio}" value="1" />
                            <p:fileDownload value="#{filtroBean.arquivoRetorno}" contentDisposition="attachment" />
                        </p:commandButton>
                        <p:commandButton value="Limpar" title="Limpar" action="#{filtroBean.limparRelacao}" update="relacao" ajax="true" image="ui-icon ui-icon-close" >
                            <f:setPropertyActionListener target="#{filtroBean.relacaoSelecionada}" value="#{null}" />
                            <f:setPropertyActionListener target="#{filtroBean.dataIniRelacao}" value="#{null}" />
                            <f:setPropertyActionListener target="#{filtroBean.dataFimRelacao}" value="#{null}" />
                        </p:commandButton>
                    </h:panelGroup>
                    </center>
                    </p:fieldset>
                </h:form>
            </p:tab>
            <p:tab title="Filtro" >
                <h:form id="filtro" prependId="false" >
                    <p:fieldset>
                    <h:panelGrid columns="1" >
                        <h:outputLabel value="Filtrar processo:" style="font-weight: bold" />
                        <h:selectOneMenu value="#{filtroBean.filtroSelecionado}" >
                            <f:selectItem itemValue="-1" itemLabel="Selecione" />
                            <f:selectItem itemValue="1" itemLabel="Ativo" />
                            <f:selectItem itemValue="2" itemLabel="Arquivado" />
                            <p:ajax update="tabelaProcesso, tabelaVolumes, tabelaAnexos" event="change"  />
                        </h:selectOneMenu>
                        <h:outputLabel value="Data inicial:" style="font-weight: bold" />
                        <p:calendar id="dataIni" value="#{filtroBean.dataIni}" size="12" required="true" showOn="button" validatorMessage="O formato deve ser dd/mm/aaaa" requiredMessage="Campo Data inicial obrigatório!" readOnlyInputText="true" locale="pt,BR" timeZone="America/Sao_Paulo" pattern="dd/MM/yyyy"  /> 
                        <h:outputLabel value="Data final:" style="font-weight: bold" />
                        <p:calendar id="dataFim" value="#{filtroBean.dataFim}" size="12" required="true" showOn="button" validatorMessage="O formato deve ser dd/mm/aaaa" requiredMessage="Campo Data final obrigatório!" readOnlyInputText="true" locale="pt,BR" timeZone="America/Sao_Paulo" pattern="dd/MM/yyyy"  /> 
                    </h:panelGrid>
                    </p:fieldset>
                    <p:fieldset>
                    <center>
                    <h:panelGroup>
                        <p:commandButton value="Buscar" action="#{filtroBean.buscar}" update="tabelaProcesso, tabelaVolumes, tabelaAnexos, mensagens" ajax="true" image="ui-icon ui-icon-search" >
                            <f:setPropertyActionListener target="#{filtroBean.dataIni}" value="#{filtroBean.dataIni}" />
                            <f:setPropertyActionListener target="#{filtroBean.dataFim}" value="#{filtroBean.dataFim}" />
                            <f:setPropertyActionListener target="#{filtroBean.filtroSelecionado}" value="#{filtroBean.filtroSelecionado}" />
                        </p:commandButton>
                        <p:commandButton value="Limpar" title="Limpar" action="#{filtroBean.limpar}" update="filtro, tabelaProcesso, tabelaVolumes, tabelaAnexos, mensagens" ajax="true" image="ui-icon ui-icon-close" >
                            <f:setPropertyActionListener target="#{filtroBean.filtroSelecionado}" value="#{-1}" />
                            <f:setPropertyActionListener target="#{filtroBean.dataIni}" value="#{null}" />
                            <f:setPropertyActionListener target="#{filtroBean.dataFim}" value="#{null}" />
                        </p:commandButton>
                    </h:panelGroup>
                    </center>
                    </p:fieldset>
                </h:form>
            </p:tab>
       </p:accordionPanel>
    </p:layoutUnit>
    <p:layoutUnit scrollable="true" position="center"  >
        <p:tabView effect="opacity" effectDuration="normal">
            <p:tab title="Processos">
                <ui:insert>
                    <ui:include src="/restrito/processo/consultar/pags.xhtml"/>    
                </ui:insert>
            </p:tab>
            <p:tab title="Volumes">
                <ui:insert>
                    <ui:include src="/restrito/processo/consultar/volumes.xhtml"/>    
                </ui:insert>
            </p:tab>
            <p:tab title="Anexos">
                <ui:insert>
                    <ui:include src="/restrito/processo/consultar/anexos.xhtml"/>    
                </ui:insert>
            </p:tab>
        </p:tabView>
    </p:layoutUnit>
</p:layout>

<p:dialog header="Tramitações" widgetVar="tramitacaoVolumeDialog" resizable="false" modal="true" width="960" showEffect="explode" hideEffect="explode" position="top">  
    <h:form id="tramitacaoVolume" prependId="false" >
        <h:inputHidden value="#{tramitacaoVolumeBean.tramitacaoVolume.idtramitaVolume}" />
        <center>
            <h:graphicImage library="imagens" name="logo.png" width="380" style="border:0" />
            <hr />
            <h:outputLabel value="PAG" style="font-weight: bold; font-size: 14px" />
            <h:outputLabel value="#{tramitacaoVolumeBean.processoSelecionado}" style="font-weight: bold; font-size: 14px" >
                 <f:converter converterId="ConverteIDtoPagId"/>
            </h:outputLabel>
        </center>
        <hr />
        <p:dataTable var="tramitaVolume" value="#{tramitacaoVolumeBean.listar}" emptyMessage="Não há informações!" 
            paginator="true" paginatorPosition="both" rows="15" paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"  
            rowsPerPageTemplate="5,15,30" style="overflow: auto;">
            <p:column headerText="OM remetente"  >
                <center>
                    <h:outputText value="#{tramitaVolume.unidadeRemetente}" title="Encaminhado por: #{tramitaVolume.remetente}"/>
                </center>
            </p:column>
            <p:column headerText="Setor remetente"  >
                <center>
                    <h:outputText value="#{tramitaVolume.setorRemetente}" />
                </center>
            </p:column>
            <p:column headerText="OM destino" style="width: 5%" >
                <center>
                    <h:outputText value="#{tramitaVolume.unidadeDestino}" />
                </center>
            </p:column>
            <p:column headerText="Setor destino" style="width: 5%" >
                <center>
                    <h:outputText value="#{tramitaVolume.setorDestino}" />
                </center>
            </p:column>
            <p:column headerText="Data despacho" style="width: 5%" >
                <center>
                <h:outputText value="#{tramitaVolume.dataTramitacao}" >
                    <f:convertDateTime pattern="dd/MM/yyyy 'às' HH:mm:ss" locale="pt,BR" timeZone="America/Sao_Paulo" />
                </h:outputText>
                </center>
            </p:column>
            <p:column headerText="Despacho" >
                <center>
                    <h:outputText value="#{tramitaVolume.despacho}" />
                </center>
            </p:column>
        </p:dataTable>
        <br />
        <center>
            <p:commandButton oncomplete="tramitacaoVolumeDialog.hide();" action="tramitacaoVolumeDialog.hide();" value="Fechar"/>
        </center>
    </h:form>
</p:dialog>

<p:dialog header="Tramitações" widgetVar="tramitacaoAnexoDialog" resizable="false" modal="true" width="960" showEffect="explode" hideEffect="explode" position="top">  
    <h:form id="tramitacaoAnexo" prependId="false" >
        <h:inputHidden value="#{tramitacaoAnexoBean.tramitacaoAnexo.idtramitaAnexo}" />
        <center>
            <h:graphicImage library="imagens" name="logo.png" width="380" style="border:0" />
            <hr />
            <h:outputLabel value="PAG" style="font-weight: bold; font-size: 14px" />
            <h:outputLabel value="#{tramitacaoAnexoBean.processoSelecionado}" style="font-weight: bold; font-size: 14px" >
                <f:converter converterId="ConverteIDtoPagId"/>
            </h:outputLabel>
        </center>
        <hr />
        <p:dataTable var="tramitaAnexo" value="#{tramitacaoAnexoBean.listar}" emptyMessage="Não há informações!" 
            paginator="true" paginatorPosition="both" rows="15" paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"  
            rowsPerPageTemplate="5,15,30" style="overflow: auto;">
            <p:column headerText="OM remetente" style="width: 5%" >
                <center>
                    <h:outputText value="#{tramitaAnexo.unidadeRemetente}" title="Encaminhado por: #{tramitaAnexo.remetente}"/>
                </center>
            </p:column>
            <p:column headerText="Setor remetente" style="width: 5%" >
                <center>
                    <h:outputText value="#{tramitaAnexo.setorRemetente}" />
                </center>
            </p:column>
            <p:column headerText="OM destino" style="width: 5%" >
                <center>
                    <h:outputText value="#{tramitaAnexo.unidadeDestino}" />
                </center>
            </p:column>
            <p:column headerText="Setor destino" style="width: 5%" >
                <center>
                    <h:outputText value="#{tramitaAnexo.setorDestino}" />
                </center>
            </p:column>
            <p:column headerText="Data despacho" style="width: 5%" >
                <center>
                <h:outputText value="#{tramitaAnexo.dataTramitacao}" >
                    <f:convertDateTime pattern="dd/MM/yyyy 'às' HH:mm:ss" locale="pt,BR" timeZone="America/Sao_Paulo" />
                </h:outputText>
                </center>
            </p:column>
            <p:column headerText="Despacho" >
                <center>
                    <h:outputText value="#{tramitaAnexo.despacho}" />
                </center>
            </p:column>
        </p:dataTable>
        <br />
        <center>
            <p:commandButton oncomplete="tramitacaoAnexoDialog.hide();" action="tramitacaoAnexoDialog.hide();" value="Fechar"/>
        </center>
    </h:form>
</p:dialog>

<p:dialog header="Detalhes do processo" widgetVar="detalhesVolumeProcessoDialog" resizable="false" modal="true" width="450" showEffect="explode" hideEffect="explode" >  
    <h:form id="detalhesVolumeProcesso" prependId="false" >
        <h:inputHidden value="#{volumeProcessoBean.volumeProcesso.idprocesso}" />
        <p:fieldset>
        <center>
            <h:graphicImage library="imagens" name="logo.png" width="380" style="border:0" />
            <br />
            <hr />
            <h:outputLabel value="PAG #{volumeProcessoBean.volumeProcesso.processo.pag}" style="font-weight: bold; font-size: 14px"/>
        </center>
        <hr />
        <h:panelGrid columns="2" cellspacing="4" cellpadding="2">
            <h:outputLabel value="PAM:" style="font-weight: bold;" />
            <h:outputLabel value="#{volumeProcessoBean.volumeProcesso.processo.pam}" />
            <h:outputLabel value="Unidade do PAM:" style="font-weight: bold;" />
            <h:outputLabel value="#{volumeProcessoBean.volumeProcesso.processo.unidadeSolicitante}" >
                <f:converter converterId="ConverteUnidadeMilitarSiglaId"/>
            </h:outputLabel>
            <h:outputLabel value="Setor do PAM:" style="font-weight: bold;" />
            <h:outputLabel value="#{volumeProcessoBean.volumeProcesso.processo.setorSolicitante}" >
                <f:converter converterId="ConverteSetorSiglaId"/>
            </h:outputLabel>
            <h:outputLabel value="Data do PAG:" style="font-weight: bold;" />
            <h:outputLabel value="#{volumeProcessoBean.volumeProcesso.processo.dataProcesso}" >
                <f:convertDateTime dateStyle="medium" locale="pt,BR" timeZone="America/Sao_Paulo" />
            </h:outputLabel>
            <h:outputLabel value="Status" style="font-weight: bold;" />
            <h:outputLabel value="Ativo" rendered="#{volumeProcessoBean.volumeProcesso.processo.status == 1}" style="color: green; text-decoration: blink;" />
            <h:outputLabel value="Arquivado" rendered="#{volumeProcessoBean.volumeProcesso.processo.status == 2}" style="color: red;" />
            <h:outputLabel value="Objeto:" style="font-weight: bold;" />
            <h:outputLabel value="#{volumeProcessoBean.volumeProcesso.processo.objeto}" style="text-align: justify;"/>
            <h:outputLabel value="Cadastrado por:" style="font-weight: bold;" />
            <h:outputLabel value="#{volumeProcessoBean.volumeProcesso.processo.cadastradoPor}" style="text-align: justify;"/>
            <h:outputLabel value="Cadastrado em:" style="font-weight: bold;" />
            <h:outputLabel value="#{volumeProcessoBean.volumeProcesso.processo.dataCadastramento}" >
                <f:convertDateTime dateStyle="medium" locale="pt,BR" timeZone="America/Sao_Paulo" />
            </h:outputLabel>
            <h:outputLabel value="Motivo arquivamento:" style="font-weight: bold;" rendered="#{!empty volumeProcessoBean.volumeProcesso.processo.motivoArquivamento}" />
            <h:outputLabel value="#{volumeProcessoBean.volumeProcesso.processo.motivoArquivamento}" style="text-align: justify;" rendered="#{!empty volumeProcessoBean.volumeProcesso.processo.motivoArquivamento}" />
        </h:panelGrid>
        </p:fieldset>
        <br />
        <center>
            <p:commandButton oncomplete="detalhesVolumeProcessoDialog.hide();" action="detalhesVolumeProcessoDialog.hide();" value="Fechar"/>
        </center>
    </h:form>
</p:dialog>

<p:dialog header="Detalhes do processo" widgetVar="detalhesAnexoProcessoDialog" resizable="false" modal="true" width="450" showEffect="explode" hideEffect="explode" >  
    <h:form id="detalhesAnexoProcesso" prependId="false" >
        <h:inputHidden value="#{anexoProcessoBean.anexoProcesso.idprocesso}" />
        <p:fieldset>
        <center>
            <h:graphicImage library="imagens" name="logo.png" width="380" style="border:0" />
            <br />
            <hr />
            <h:outputLabel value="PAG #{anexoProcessoBean.anexoProcesso.processo.pag}" style="font-weight: bold; font-size: 14px"/>
        </center>
        <hr />
        <h:panelGrid columns="2" cellspacing="4" cellpadding="2">
            <h:outputLabel value="PAM:" style="font-weight: bold;" />
            <h:outputLabel value="#{anexoProcessoBean.anexoProcesso.processo.pam}" />
            <h:outputLabel value="Unidade do PAM:" style="font-weight: bold;" />
            <h:outputLabel value="#{anexoProcessoBean.anexoProcesso.processo.unidadeSolicitante}" >
                <f:converter converterId="ConverteUnidadeMilitarSiglaId"/>
            </h:outputLabel>
            <h:outputLabel value="Setor do PAM:" style="font-weight: bold;" />
            <h:outputLabel value="#{anexoProcessoBean.anexoProcesso.processo.setorSolicitante}" >
                <f:converter converterId="ConverteSetorSiglaId"/>
            </h:outputLabel>
            <h:outputLabel value="Data do PAG:" style="font-weight: bold;" />
            <h:outputLabel value="#{anexoProcessoBean.anexoProcesso.processo.dataProcesso}" >
                <f:convertDateTime dateStyle="medium" locale="pt,BR" timeZone="America/Sao_Paulo" />
            </h:outputLabel>
            <h:outputLabel value="Status" style="font-weight: bold;" />
            <h:outputLabel value="Ativo" rendered="#{anexoProcessoBean.anexoProcesso.processo.status == 1}" style="color: green; text-decoration: blink;" />
            <h:outputLabel value="Arquivado" rendered="#{anexoProcessoBean.anexoProcesso.processo.status == 2}" style="color: red;" />
            <h:outputLabel value="Objeto:" style="font-weight: bold;" />
            <h:outputLabel value="#{anexoProcessoBean.anexoProcesso.processo.objeto}" style="text-align: justify;"/>
            <h:outputLabel value="Cadastrado por:" style="font-weight: bold;" />
            <h:outputLabel value="#{anexoProcessoBean.anexoProcesso.processo.cadastradoPor}" style="text-align: justify;"/>
            <h:outputLabel value="Cadastrado em:" style="font-weight: bold;" />
            <h:outputLabel value="#{anexoProcessoBean.anexoProcesso.processo.dataCadastramento}" >
                <f:convertDateTime dateStyle="medium" locale="pt,BR" timeZone="America/Sao_Paulo" />
            </h:outputLabel>
            <h:outputLabel value="Motivo arquivamento:" style="font-weight: bold;" rendered="#{!empty anexoProcessoBean.anexoProcesso.processo.motivoArquivamento}" />
            <h:outputLabel value="#{anexoProcessoBean.anexoProcesso.processo.motivoArquivamento}" style="text-align: justify;" rendered="#{!empty anexoProcessoBean.anexoProcesso.processo.motivoArquivamento}" />
        </h:panelGrid>
        </p:fieldset>
        <br />
        <center>
            <p:commandButton oncomplete="detalhesAnexoProcessoDialog.hide();" action="detalhesAnexoProcessoDialog.hide();" value="Fechar"/>
        </center>
    </h:form>
</p:dialog>

<p:dialog header="Detalhes do processo" widgetVar="detalhesProcessoDialog" resizable="false" modal="true" width="450" showEffect="explode" hideEffect="explode" >  
    <h:form id="detalhesProcesso" prependId="false" >
        <h:inputHidden value="#{processoBean.processo.idprocesso}" />
        <p:fieldset>
        <center>
            <h:graphicImage library="imagens" name="logo.png" width="380" style="border:0" />
            <br />
            <hr />
            <h:outputLabel value="PAG #{processoBean.processo.pag}" style="font-weight: bold; font-size: 14px"/>
        </center>
        <hr />
        <h:panelGrid columns="2" cellspacing="4" cellpadding="2">
            <h:outputLabel value="PAM:" style="font-weight: bold;" />
            <h:outputLabel value="#{processoBean.processo.pam}" />
            <h:outputLabel value="Unidade do PAM:" style="font-weight: bold;" />
            <h:outputLabel value="#{processoBean.processo.unidadeSolicitante}" >
                <f:converter converterId="ConverteUnidadeMilitarSiglaId"/>
            </h:outputLabel>
            <h:outputLabel value="Setor do PAM:" style="font-weight: bold;" />
            <h:outputLabel value="#{processoBean.processo.setorSolicitante}" >
                <f:converter converterId="ConverteSetorSiglaId"/>
            </h:outputLabel>
            <h:outputLabel value="Data do PAG:" style="font-weight: bold;" />
            <h:outputLabel value="#{processoBean.processo.dataProcesso}" >
                <f:convertDateTime dateStyle="medium" locale="pt,BR" timeZone="America/Sao_Paulo" />
            </h:outputLabel>
            <h:outputLabel value="Status" style="font-weight: bold;" />
            <h:outputLabel value="Ativo" rendered="#{processoBean.processo.status == 1}" style="color: green; text-decoration: blink;" />
            <h:outputLabel value="Arquivado" rendered="#{processoBean.processo.status == 2}" style="color: red;" />
            <h:outputLabel value="Objeto:" style="font-weight: bold;" />
            <h:outputLabel value="#{processoBean.processo.objeto}" style="text-align: justify;"/>
            <h:outputLabel value="Cadastrado por:" style="font-weight: bold;" />
            <h:outputLabel value="#{processoBean.processo.cadastradoPor}" style="text-align: justify;"/>
            <h:outputLabel value="Cadastrado em:" style="font-weight: bold;" />
            <h:outputLabel value="#{processoBean.processo.dataCadastramento}" >
                <f:convertDateTime dateStyle="medium" locale="pt,BR" timeZone="America/Sao_Paulo" />
            </h:outputLabel>
            <h:outputLabel value="Motivo arquivamento:" style="font-weight: bold;" rendered="#{!empty processoBean.processo.motivoArquivamento}" />
            <h:outputLabel value="#{processoBean.processo.motivoArquivamento}" style="text-align: justify;" rendered="#{!empty processoBean.processo.motivoArquivamento}" />
        </h:panelGrid>
        </p:fieldset>
        <br />
        <center>
            <p:commandButton oncomplete="detalhesProcessoDialog.hide();" action="detalhesProcessoDialog.hide();" value="Fechar"/>
        </center>
    </h:form>
</p:dialog>

<p:dialog header="Volumes" widgetVar="volumeDialog" resizable="false" modal="true" width="650" showEffect="explode" hideEffect="explode" position="top">  
    <h:form id="tabelaVolumes2" prependId="false" >
        <p:dataTable var="volume" value="#{volumeProcessoBean.listarVolumesPorProcesso}" emptyMessage="Não há informações!"
            paginator="true" paginatorPosition="top" rows="15" selectionMode="single"  
            paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"  
            rowsPerPageTemplate="15,30,60" style="overflow: auto;" >
            <h:inputHidden value="#{volume.idprocesso}" />
            <h:inputHidden value="#{volume.idvolume}" />
            <p:columnGroup type="header">  
                <p:row>
                    <p:column colspan="5" headerText="PAG #{volumeProcessoBean.numeroPag}" style="color: black; font-size: 12px"/>
                </p:row> 
                <p:row>  
                    <p:column headerText="Volume" /> 
                    <p:column headerText="Local físico (OM)" />
                    <p:column headerText="Setor atual" /> 
                    <p:column headerText="Último movimento" />
                    <p:column headerText="" />
                </p:row> 
            </p:columnGroup>
            <p:column>
                <center>
                    <h:outputText value="#{volume.volume}" />
                </center>
            </p:column>
            <p:column>
                <center>
                    <h:outputText value="#{volume.unidadeAtual}" >
                        <f:converter converterId="ConverteUnidadeMilitarSiglaId"/>
                    </h:outputText>
                </center>
            </p:column>
            <p:column>
                <center>
                    <h:outputText value="#{volume.setorAtual}" >
                        <f:converter converterId="ConverteSetorSiglaId"/>
                    </h:outputText>
                </center>
            </p:column>
            <p:column headerText="Último movimento" >
                <center>
                    <h:outputText value="#{volume.dataEntradaSetor}" >
                        <f:convertDateTime pattern="dd/MM/yyyy 'às' HH:mm:ss" locale="pt,BR" timeZone="America/Sao_Paulo" />
                    </h:outputText>
                </center>
            </p:column>
            <p:column>
                <center>
                    <p:commandButton value="Tramitações" immediate="true"  update="tramitacaoVolume" image="ui-icon ui-icon-transferthick-e-w" onclick="tramitacaoVolumeDialog.show()" >
                        <f:setPropertyActionListener target="#{tramitacaoVolumeBean.volumeSelecionado}" value="#{volume.idvolume}" />
                        <f:setPropertyActionListener target="#{tramitacaoVolumeBean.processoSelecionado}" value="#{volume.idprocesso}" />
                    </p:commandButton>
                </center>
            </p:column>
        </p:dataTable>
        <br />
        <center>
            <p:commandButton value="Fechar" oncomplete="volumeDialog.hide();" action="volumeDialog.hide();" />
        </center>
    </h:form>
</p:dialog>
<p:dialog header="Anexos" widgetVar="anexoDialog" resizable="false" modal="true" width="650" showEffect="explode" hideEffect="explode" position="top">  
    <h:form id="tabelaAnexos2" prependId="false" >
        <p:dataTable var="anexo" value="#{anexoProcessoBean.listarAnexosPorProcesso}" emptyMessage="Não há informações!"
            paginator="true" paginatorPosition="top" rows="15" selectionMode="single"  
            paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"  
            rowsPerPageTemplate="15,30,60" style="overflow: auto;" >
            <h:inputHidden value="#{anexo.idprocesso}" />
            <h:inputHidden value="#{anexo.idanexo}" />
            <p:columnGroup type="header">  
                <p:row>
                    <p:column colspan="5" headerText="PAG #{anexoProcessoBean.numeroPag}" style="color: black; font-size: 12px"/>
                </p:row> 
                <p:row>  
                    <p:column headerText="Anexo" /> 
                    <p:column headerText="Local físico (OM)" />
                    <p:column headerText="Setor atual" /> 
                    <p:column headerText="Último movimento" />
                    <p:column headerText="" /> 
                </p:row> 
            </p:columnGroup>
            <p:column>
                <center>
                    <h:outputText value="#{anexo.anexo}" />
                </center>
            </p:column>
            <p:column>
                <center>
                    <h:outputText value="#{anexo.unidadeAtual}" >
                        <f:converter converterId="ConverteUnidadeMilitarSiglaId"/>
                    </h:outputText>
                </center>
            </p:column>
            <p:column>
                <center>
                    <h:outputText value="#{anexo.setorAtual}" >
                        <f:converter converterId="ConverteSetorSiglaId"/>
                    </h:outputText>
                </center>
            </p:column>
            <p:column headerText="Último movimento" >
                <center>
                    <h:outputText value="#{anexo.dataEntradaSetor}" >
                        <f:convertDateTime pattern="dd/MM/yyyy 'às' HH:mm:ss" locale="pt,BR" timeZone="America/Sao_Paulo" />
                    </h:outputText>
                </center>
            </p:column>
            <p:column>
                <center>
                    <p:commandButton value="Tramitações" immediate="true" update="tramitacaoAnexo" image="ui-icon ui-icon-transferthick-e-w" onclick="tramitacaoAnexoDialog.show()" >
                        <f:setPropertyActionListener target="#{tramitacaoAnexoBean.anexoSelecionado}" value="#{anexo.idanexo}" />
                        <f:setPropertyActionListener target="#{tramitacaoAnexoBean.processoSelecionado}" value="#{anexo.idprocesso}" />
                    </p:commandButton>
                </center>
            </p:column>
        </p:dataTable>
        <br />
        <center>
            <p:commandButton value="Fechar" oncomplete="anexoDialog.hide();" action="anexoDialog.hide();" />
        </center>
    </h:form>
</p:dialog>
</ui:define>
</ui:composition>
</html>